extends "../pulimaosi-3/pulimaosi-3.gd"


var baseId = ""
func _extInit():
	._extInit()
	if isInManual():
		addSkill(sk3t1[1], sk3t1[0])
		addSkill(sk3t2[1], sk3t2[0])
	elif sk3 != 0:
		doChoiceSkill3()
	lv = 4             #等级的设置

var sk3t1 = ["英魂之力·1", "我方角色彻底阵亡时：立即对当前目标发起3次炮击"]
var sk3t2 = ["英魂之力·2", "我方角色触发亡语时：50%几率对当前目标发起1次炮击"]

func doChoiceSkill3():
	var sk = get("sk3t%d"%sk3)
	addSkill(sk[1], sk[0])

func onCharaDeathWord(cha):
	.onCharaDeathWord(cha)
	if sk3 == 2 and cha.team == 1 and sys.rndPer(50) and not isDeath:
		utils.createSkillTextEff("英魂之力", position)
		.normalAtkChara(aiCha)

func _onCharaDel(cha):
	._onCharaDel(cha)
	if not is_instance_valid(cha) or isDeath or sk3 != 1:return
	if cha.team == team:
		for i in range(3):
			yield(reTimer(0.15),"timeout")
			if aiCha == null:
				yield(reTimer(0.05),"timeout")
			.normalAtkChara(aiCha)
